<?php

class Dm_Db_Query {

	protected $db;
	
	public function __construct(&$adapter = null)
	{
		if (empty($adapter))
		{
			$this->db = &DM_Db_Adapter::$defaultAdapter;
		}
		else
		{
			$this->setAdapter( $adapter );
		}
	}
	
	public function setAdapter(&$adapter)
	{
		if ($adapter)
		{
			$this->db = &$adapter;
		}
	}

	public static function query($sql)
	{
		return $this->db->query($sql);
	}
	
	public function q($sql)
	{
		return $this->db->query($sql);
	}

}